package Day017_缓冲流_转换流_序列化流_打印流.ZuoYe;

import java.io.FileOutputStream;
import java.io.OutputStreamWriter;

/**
 * @author zhangyan
 * @date 2020/5/9 20:17
 */
public class Test7 {
    public static void main(String[] args) throws Exception{

        //创建转换流对象 指定编码
        FileOutputStream fos = new FileOutputStream("Demo02\\ccc\\a.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos,"GBK");

        //写数据
        osw.write("我爱Java");

        //关流
        osw.close();

    }
}
